package com.fy.entity;

import lombok.Data;
import org.springframework.data.neo4j.core.schema.GeneratedValue;
import org.springframework.data.neo4j.core.schema.Id;
import org.springframework.data.neo4j.core.schema.Node;
import org.springframework.data.neo4j.core.schema.Relationship;

import java.io.Serializable;
import java.util.List;

import static org.springframework.data.neo4j.core.schema.Relationship.Direction.OUTGOING;

/**
 * @ClassName Person
 * @author: maliang
 * @Description 人员
 * @date 2023/3/30 13:28
 * @Version 1.0版本
 */
@Data
@Node("person")
public class Person implements Serializable {

    @Id
    @GeneratedValue
    private Long id;

    private String name;

    private String num;

    private int age;

    private String local;

    /**
     * 拥有的商品
     */
    @Relationship("have")
    private List<ProductEntity> productEntityList;

    /**
     * 亲戚
     */
    @Relationship("kinsfolk")
    private List<Person> kinsfolkShips;

    /**
     * 拥有的汽车
     */
    @Relationship(type = "have", direction = OUTGOING)
    private List<CarEntity> cars;

}
